Skip to content

Conversation

@sgonorov
Copy link
Contributor

A small fix to make python Text2Video sample work properly:

  • Fix perf. properties naming
  • Fix color conversion

@Wovchena Wovchena requested a review from Copilot January 29, 2026 06:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issues in the Python Text2Video sample to ensure it works correctly. The changes address incorrect performance metric property access and fix color space conversion for proper video output.

Changes:

  • Update performance metrics API calls to use correct method names
  • Add proper RGB to BGR color conversion before writing video frames

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +62 to +65
print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms")
print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms")
print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms")
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms")
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent API usage: get_transformer_infer_duration() returns an object with a .mean attribute while other metrics (get_load_time() and get_generate_duration()) return scalar values directly. Consider using .mean consistently if all methods return objects with mean values, or remove .mean if this method also returns a scalar.

Suggested change
print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms")
print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms")
print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms")
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms")
print(f" Load time: {output.perf_metrics.get_load_time().mean:.2f} ms")
print(f" Generate duration: {output.perf_metrics.get_generate_duration().mean:.2f} ms")
print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms")
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration().mean:.2f} ms")

Copilot uses AI. Check for mistakes.
print(f" Load time: {output.perf_metrics.get_load_time():.2f} ms")
print(f" Generate duration: {output.perf_metrics.get_generate_duration():.2f} ms")
print(f" Transformer duration: {output.perf_metrics.get_transformer_infer_duration().mean:.2f} ms")
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms")
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name inconsistency should be verified: line 64 uses get_transformer_infer_duration().mean (with .mean attribute access) while this line uses get_vae_decoder_infer_duration() directly (without .mean). Ensure both methods have the same return type for consistency.

Suggested change
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration():.2f} ms")
print(f" VAE decoder duration: {output.perf_metrics.get_vae_decoder_infer_duration().mean:.2f} ms")

Copilot uses AI. Check for mistakes.
@Wovchena Wovchena added this pull request to the merge queue Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants